<script setup>
import {ref} from 'vue'
import {timeFormat} from "../utils/index.js";

defineProps({
  list: Array,
  default: () => {
    return []
  }
})
</script>

<template>
  <div class="list_wrap">
    <div class="item" v-for="(item,index) in list" :key="index">
      <div class="left">
        <van-image
            class="img"
            round
            width="40px"
            height="40px"
            fit="cover"
            :src="item.wxHeadImg"
        />
      </div>
      <div class="right">
        <div class="name_wrap">
          <div class="name">
            <span>{{item.name}}</span>
            <img src="../assets/images/wechart_icon.png" alt="">
            <img src="../assets/images/phone_icon.png" alt="">
          </div>
          <div class="com">{{item.companyName || '--'}}</div>
        </div>
        <div class="time_wrap">
<!--          <div class="time">昨天设置</div>-->
          <div class="time">{{ timeFormat(new Date(item.lastFollowTime).getTime()) }}</div>
          <div class=name>谭喆</div>
        </div>
      </div>
    </div>
  </div>
</template>

<style scoped lang="less">
.list_wrap {
  .item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 12px;
    height: 64px;

    .left {
      display: flex;
      align-items: center;
      margin-right: 12px;
      flex-shrink: 0;
    }

    .right {
      flex: 1;
      display: flex;
      justify-content: center;
      align-items: center;
      border-bottom: 1px solid #ECECEC;

      .name_wrap {
        flex: 1;
        display: flex;
        flex-direction: column;
        align-items: flex-start;
        justify-content: center;

        .name {
          display: flex;
          align-items: center;

          img {
            width: 12px;
            height: auto;
            margin-left: 2px;
          }

          span {
            font-size: 14px;
            color: black;
          }
        }

        .com {
          font-size: 14px;
          color: #EB4615;
          margin-top: 4px;
        }
      }

      .time_wrap {
        display: flex;
        flex-direction: column;
        align-items: flex-end;
        justify-content: center;

        .time {
          font-size: 12px;
          color: #979797;
        }

        .name {
          font-size: 12px;
          color: #979797;
          margin-top: 4px;
        }
      }
    }
  }
}
</style>